/*--------------------------------------------------------------------------------
 * Adaptive Intelligence - Foundation Framework Class Library
 * Version 2.00
 * 
 * I/O Load Failed Event Arguments Class
 *      An event arguments class for the <b>IoLoadFailed</b> event.
 *--------------------------------------------------------------------------------------------------*/

/*----------------------------------------------------------------------------------------------------
 * System Imports
 *--------------------------------------------------------------------------------------------------*/
using System;
using System.IO;

namespace Adaptive.Foundation
{
    /// <summary>
    /// An event arguments class for the <b>IoLoadFailed</b> event.
    /// </summary>
    public sealed class IoLoadFailedEventArgs : System.EventArgs
    {
        /*--------------------------------------------------------------------------------
         *  Private Member Declarations
         *------------------------------------------------------------------------------*/
        #region Private Member Declarations
        /// <summary>
        /// Gets the name of the file that failed to load.
        /// </summary>
        private string _fileName = string.Empty;
        /// <summary>
        /// Gets the exception that resulted from the failure.
        /// </summary>
        private Exception _ioException = null;
        #endregion

        /*--------------------------------------------------------------------------------
		 *  Constructor / Dispose / Destructor Methods
		 *------------------------------------------------------------------------------*/
        #region Constructor / Dispose / Destructor Methods
        /// <summary>
        /// Initializes a new instance of the class.
        /// </summary>
        /// <remarks>
        /// This is the default constructor.
        /// </remarks>
        public IoLoadFailedEventArgs()
        {
        }
        /// <summary>
        /// Initializes a new instance of the class.
        /// </summary>
        /// <param name="fileName">The name of the file that was being loaded.</param>
        public IoLoadFailedEventArgs(string fileName)
        {
            _fileName = fileName;
        }
        /// <summary>
        /// Initializes a new instance of the class.
        /// </summary>
        /// <param name="fileName">The name of the file that was being loaded.</param>
        /// <param name="ioException">The exception which occurred.</param>
        public IoLoadFailedEventArgs(string fileName, Exception ioException)
        {
            _fileName = fileName;
            _ioException = ioException;
        }
        /// <summary>
        /// Class destructor.
        /// </summary>
        ~IoLoadFailedEventArgs()
        {
            _fileName = null;
            _ioException = null;
        }
        #endregion

        /*--------------------------------------------------------------------------------
		 *  Public Properties
		 *------------------------------------------------------------------------------*/
        #region Public Properties
        /// <summary>
        /// Gets the name of the file that failed to load.
        /// </summary>
        /// <value>
        /// A file name.
        /// </value>
        public string FileName
        {
            get { return _fileName; }
        }
        /// <summary>
        /// Gets the exception that resulted from the failure.
        /// </summary>
        /// <value>
        /// A <see cref="System.Exception"/> object.
        /// </value>
        public Exception IOException
        {
            get { return _ioException; }
        }
        #endregion
    }
}